
<table>
  <tbody>
  <% result_set[:keys].each_with_index do |k,i| %>
    <tr>
      <td class="header"><%= result_set.try(:[],:labels).try(:[],i) || k.to_s.titleize %></td>
      <td>
        <% data = result_set[:object].send(k) %>
          <% if result_set[:include_link].try(:[],i) && data.class.methods.include?(:model_name) %>
            <% begin %>
              <%= link_to data, url_for(data) %>
            <% rescue %>
              <%= data %>  
            <% end %>
          <% else %>
            <%= data %>
          <% end %> 
      </td>
    </tr>
  <% end %>
  </tbody>
</table>

